package com.test;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/****
 * 请求转发  到dataServlet  可以在控制台看到得到了值
 * 请求的路径不变
 * @author Administrator
 *
 */
@WebServlet(value="/forwardServlet")
public class ForwardServlet extends HttpServlet{
   
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setAttribute("name", "lisi11111");
		req.getRequestDispatcher("/dataServlet").forward(req, resp);
	}
}
